<template>
	<view >
		<u-tabbar 
			v-model="current" 
			:list="tabBarList" 
			:mid-button="true"
			active-color='#2a5488'
			@change='change'></u-tabbar>
	</view>
</template>

<script>
export default {
	computed:{
		tabBarList:function(){
			return this.$store.state.app.tabBarList
		},
		current:{
			get(){
				return this.$store.state.app.tabBarCurrent
			},
			set(index){
				this.$store.commit('app/changeTabBarCurrent',index)
			}
		}
	},
	methods:{
		change(index){
			const page=this.tabBarList[index]
			if(page.url){
				uni.switchTab({
				    url: page.url
				});
			}
		}
	}
};
</script>

<style  scoped>

</style>